const token = localStorage.token;
$.ajaxSetup({
    headers:{
        Authorization: token
    },
    error({status}){
        if (status == 401) {
            alert("登录时间已过，请重新登录~")
            location.assign("./../html/login.html");
        }
    }
})
if (token) {
    $.ajax({
        url :'/Users/token',
        type: 'post',
        success(data){
            console.log(data);
        }
    })
}else{
    alert("没有登录，请先登录~")
    location.assign("./../html/login.html");
}